function showAuditTrail(resId,type)
{
	closedialog = 0;
	var msgDialog = $("#EmptyMessageDialog");
	msgDialog.dialog({
		height : 115,
		//modal:true,
		resizable : false,
		title: simpleLabel_Message,
		open: function() {
			var l = $(".auditTrail:visible").offset().left - $("#EmptyMessageDialog").parent().width() + 54;
			var t = $(".auditTrail:visible").offset().top - $("#EmptyMessageDialog").parent().height() - 14;
			$(this).parent().css("top",t);
			$(this).parent().css("left",l);
			getAuditTrail(fillAuditTrail,resId,type);
		},
		close: function() { cancelClearRender(null); }
	});
	msgDialog.html("<img src=\"images/loading.gif\" style=\"margin-left: 120px;margin-top: 20px;\">");
}

function getAuditTrail(callback, id,type)
{
	var url = "/auditTrailService";
	if(type == 'resId')
		var data = { func : "GetList", resId: id };
	else
		var data = { func : "GetList", groupId: id };
	simpleservice(url,data,callback);
}

function fillAuditTrail(data)
{
	var objArray = JSON.parse(data);
	
	var rowFormat = "<tr><td>{0}</td><td>{1}</td></tr>";
	var rowString = "";

	for(var i=0;i<objArray.length;i++)
		rowString += rowFormat.format(objArray[i].stampDate,objArray[i].title);
	
	var tableString = "<table class=\"auditTrailTable\"><tr><td>{0}</td><td>{1}</td></tr>{2}</table>";
	var render = tableString.format(simpleLabel_Date,simpleLabel_Description,rowString);

	$("#EmptyMessageDialog").parent().css("width",750);
	$("#EmptyMessageDialog").parent().css("left",$(".auditTrail:visible").offset().left - 750 + 50);
	$("#EmptyMessageDialog").html(render);
}